package com.yunshang.ys.api;

import com.yunshang.ys.bean.UserBean;
import com.yunshang.ys.ys.YSHttpResult;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by Administrator on 2017/7/5.
 */

public interface AccessApi {


    /**
     * 注册
     * @param userId
     * @param userName
     * @param userIcon
     * @param email
     * @param phone
     * @param password
     * @return
     */
    @FormUrlEncoded
    @POST("ajax/register")
    Observable<YSHttpResult<String>> netRegister (
            @Field("userId") String userId,
            @Field("userName") String userName,
            @Field("userIcon") String userIcon,
            @Field("email") String email,
            @Field("phone") String phone,
            @Field("password") String password);

    /**
     * 登陆
     * @param userId
     * @param password
     * @return
     */
    @FormUrlEncoded
    @POST("ajax/session")
    Observable<YSHttpResult<UserBean>> netLogin (
            @Field("userId") String userId,
            @Field("password") String password);
}
